<?php
/**
 * @Author: Marte
 * @Date:   2017-08-07 07:43:23
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-08-17 21:23:21
 */
session_start();

    if(!isset($_SESSION['username']))
    {
        echo "<script>location='dl.php';</script>";
    }
if(!isset($_GET['change']))
{
    $_page=1;
}else{
    $_page=$_GET['change'];
}
include "data/config_connect.php";

$username=$_SESSION['username'];
$_sql1='select * from userregisters where username="'.$username.'"';
$_result=$_mysql->query($_sql1);//返回结果集合
$_assoc=$_result->fetch_assoc();
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>个人中心</title>
    <link rel="stylesheet" type="text/css" href="css/person.css">
    <script src="js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8" ></script>
    <script src="js/person.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript" src="js/citydata.js"></script>
    <script type="text/javascript" src="js/cityPicker-1.0.0.js?v=1"></script>
    <script src="js/send_message.js" type="text/javascript" charset="utf-8"></script>


</head>
<body>
<div class="header">
    <div class="header_main">
        <div class="header_main_left">
 <img src="images/personlogo.png" alt="">
        </div>
        <div class="nav">
            <ul>
                <li class="first"><a href="person.php" title="">个人首页</a></li>
                <li><a href="mybookrack.php" title="">朕的书架</a></li>
                <li><a href="messages.php" title="">消息中心</a></li>
                <li><a href="" title="">书荒区</a></li>
            </ul>
        </div>
        <div class="header_main_right">
            <ul>
                <li><a href="index.php" title="">墨轩首页</a></li>
                <li class="user"><a href="" title=""><?php echo $_SESSION['username'];?></a></li>
                <div class="list"><ul>
                    <li><a href="person.php?change=2" title="">充值</a></li>
                    <li><a href="person.php?change=3" title="">个人设置</a></li>
                    <li><a href="" title="">联系客服</a></li>
                    <li><a href="data/user/logout.php?exit=1" title="">退出</a></li>
                </ul></div>
            </ul>

        </div>
    </div>



    <!-- main -->
    <div class="main">
        <div class="main_left">
            <div class="pic">
                <img src='<?php  echo $_assoc['headicon'];?>' alt="">
                <ul>
                    <li class="first1"><p><?php  echo $_assoc['fans'];?></p><span>粉丝</span></li>
                    <li class="second2"><p><?php  echo $_assoc['selectnum'];?></p><span>书架</span></li>
                </ul>
                <div class="clear">

                </div>
            </div>

            <div class="lists">
                <ul>
                    <li class="first11"><i><img src="images/souye.png" alt=""></i><a href="person.php?change=1" title="">个人首页</a></li>
                    <li><i><img src="images/xiaoxi.png" alt=""></i><a href="messages.php" title="">我的消息</a></li>
                    <li><i><img src="images/zhanghu.png" alt=""></i><a href="person.php?change=2" title="">我的账户</a></li>
                    <li><i><img src="images/shuyou.png" alt=""></i><a href="person.php?change=4" title="">墨轩书友</a></li>
                    <li><i><img src="images/guanzhu.png" alt=""></i><a href="person.php?change=5" title="">我的关注</a></li>
                    <li class="center1"><i><img src="images/huiyuan.png" alt=""></i><a href="javascript:;" title="">会员中心</a></li>
                    <li><i><img src="images/anquan.png" alt=""></i><a href="javascript:;" title="">安全中心</a></li>
                    <li><i><img src="images/dongtai.png" alt=""></i><a href="person.php?change=6" title="">我的动态</a></li>
                    <li><i><img src="images/shezhi.png" alt=""></i><a href="person.php?change=3" title="">个人设置</a></li>

                    <li class="center2"><i><img src="images/zuojia.png" alt=""></i><a href="author_register.php" title="">作家专区</a></li>
                    <li><i><img src="images/renwu.png" alt=""></i><a href="javascript:;" title="">任务</a></li>
                    <li><i><img src="images/dengji.png" alt=""></i><a href="javascript:;" title="">经验值等级</a></li>
                </ul>
            </div>
        </div>
        <div class="main_right">
        <!-- 首页 -->

                    <!-- include 'include/personindex.php'; -->

        <!-- 账户   -->

                     <!-- include 'include/personyue.php'; -->

        <!-- 个人设置 -->

                    <!-- include 'include/person_shezhi_inc.php'; -->


    <?php
        switch($_page)
        {
            case 1:include 'include/personindex.php';break;
            case 2:include 'include/personyue.php';break;
            case 3:include 'include/person_shezhi_inc.php';break;
            case 4:include 'include/person_book_friends.php';break;
            case 5:include 'include/person_followme.inc.php';break;
            case 6:include 'include/person_dongtai.inc.php';break;
        }
    ?>
        </div>
    </div>
    <div style="clear:both;">

</div>
<?php
        require 'include/zhuce.footer.inc.php';

?>
</div>


<script type="text/javascript">
$(function(){
    function tabs(tabTit,on,tabCon){
        $(tabTit).children().hover(function(){
            $(this).addClass(on).siblings().removeClass(on);
            var index = $(tabTit).children().index(this);
            $(tabCon).children().eq(index).show().siblings().hide();
        });
    };
    tabs(".tab-hd","active",".tab-bd");
});
</script>
<script type="text/javascript">
    $(function () {

        //模拟城市-无联动/无搜索
        var selector = $('#city-picker-selector').cityPicker({
            dataJson: cityData,
            renderMode: true,
            search: false,
            linkage: false
        })
        $('#city-picker-selector').on('choose-province.citypicker', function(event, tagert, storage) {
            console.log(storage);
        });

        //设置城市
        selector.setCityVal([{
            'id': '110000',
            'name': '北京市'
        }, {
            'id': '110100',
            'name': '北京市'
        }, {
            'id': '110108',
            'name': '海淀区'
        }]);

        //模拟城市-联动/搜索
        $('#city-picker-search').cityPicker({
            dataJson: cityData,
            renderMode: true,
            search: true,
            linkage: true
        });

        //原生城市-无联动
        var select = $('.city-picker-select').cityPicker({
            dataJson: cityData,
            renderMode: false,
            linkage: false
        });

        //设置城市
        select.setCityVal([{
            'id': '140000',
            'name': '山西省'
        }, {
            'id': '140100',
            'name': '太原市'
        }, {
            'id': '140105',
            'name': '小店区'
        }]);
    });
</script>

</body>
</html>
